package com.central.scheduler.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.central.db.mapper.SuperMapper;
import com.central.scheduler.dao.model.ProcessDefinitionLog;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author Tindy
 * @date 2021/11/1
 * @describe
 * process definition log mapper interface
 */
@Mapper
public interface ProcessDefinitionLogMapper extends SuperMapper<ProcessDefinitionLog> {

    @Select("select max(version) from sch_process_definition_log where code = #{code}")
    Integer queryMaxVersionForDefinition(@Param("code") long code);

    ProcessDefinitionLog queryByDefinitionCodeAndVersion(@Param("code") long code,  @Param("version") int version);

    ProcessDefinitionLog findProcessLogDtl(@Param("proId") Long proId,@Param("code") Long code,@Param("version") Integer version);

}
